import { approveList, approveTask } from '@/api/approve'

export default defineStore('useApprove', {
  state: () => ({}),
  getters: {},
  actions: {
    //行政审批列表
    async getApproveList(params) {
      let url = $globalRequestUrl({
        url: approveList,
      })

      try {
        const rep = await $globalRequest(url, params, { method: 'POST' })
        return rep
      } catch (error) {
        return error
      }
    },

    //审批
    async approveTask(params) {
      let url = $globalRequestUrl({
        url: approveTask,
      })

      try {
        const rep = await $globalRequest(url, params, { method: 'POST' })
        return rep
      } catch (error) {
        return error
      }
    },
  },
})
